body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #faf8ef;
}

.container {
    text-align: center;
    width: 500px;
    padding: 0 20px;
}

h1 {
    color: #776e65;
    font-size: 72px;
    margin: 0;
    font-weight: bold;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.score-box {
    background-color: #bbada0;
    padding: 10px 25px;
    border-radius: 3px;
    color: white;
}

.score-label {
    text-transform: uppercase;
    font-size: 13px;
    margin-bottom: 5px;
}

#score, #highScore {
    font-size: 20px;
    font-weight: bold;
}

.new-game-btn {
    background-color: #8f7a66;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin: 10px 0;
    width: 130px;
}

.new-game-btn:hover {
    background-color: #7f6a56;
}

.game-hint {
    color: #776e65;
    margin: 15px 0;
    font-size: 16px;
}

.game-container {
    background-color: #bbada0;
    border-radius: 6px;
    padding: 15px;
    margin-top: 25px;
}

#grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 450px;
    height: 450px;
}

.tile {
    background-color: #cdc1b4;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 35px;
    font-weight: bold;
    color: #776e65;
    transition: all 0.15s ease-in-out;
    position: relative;
    transform-origin: center;
}

.tile-2 { background-color: #eee4da; }
.tile-4 { background-color: #ede0c8; }
.tile-8 { background-color: #f2b179; color: white; }
.tile-16 { background-color: #f59563; color: white; }
.tile-32 { background-color: #f67c5f; color: white; }
.tile-64 { background-color: #f65e3b; color: white; }
.tile-128 { background-color: #edcf72; color: white; font-size: 30px; }
.tile-256 { background-color: #edcc61; color: white; font-size: 30px; }
.tile-512 { background-color: #edc850; color: white; font-size: 30px; }
.tile-1024 { background-color: #edc53f; color: white; font-size: 25px; }
.tile-2048 { background-color: #edc22e; color: white; font-size: 25px; }

.tile-new {
    animation: appear 0.2s ease-in-out;
}

.tile-merge {
    animation: merge 0.2s ease-in-out;
}

@keyframes appear {
    0% { 
        opacity: 0; 
        transform: scale(0); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes merge {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.1); 
    }
    100% { 
        transform: scale(1); 
    }
}
